home *** CD-ROM | disk | FTP | other *** search
- PRIN
- Version 3.1
- Copyright (C) Drake Koefoed 1992
-
- Major changes:
-
- Version 3.1 new things are the Z option for respect the original
- pagination, named z because it's probably the last thing you want to do.
- And the U option for an upper margin at top of each page.
-
- New features truncate and box aliasing. The case sensitive commands are
- gone. You may now type prin commands in caps if you can stand them.
-
- Prin now keeps track of lines and pages printed, and the start and
- finish time of the print job. Every print job is a printer speed test.
- Not a prin speed test; on a 16 mhz sx it will do over 100 lines a second
- printing to a ram disk.
-
- By use of this program, you agree to hold the author free from any
- liability of any kind. See legal junk at the end.
-
-
- CONTENTS
- ========
-
- How to use prin
- Command line options
- Altering defaults
- Beta testing
- Registration
- Laurels and Legalese
-
-
- HOW TO USE PRIN
- ===============
-
- PRIN is called up by the command
-
- PRIN filename [options]
-
- where (filename) is the name of a file. If no filename or options are
- specified, you get a help screen. Otherwise, PRIN will print the
- contents of the file named, at 60 lines per page (unless you specify
- another page size with the /l parameter, explained below). Unless you
- use the /n parameter (explained below), PRIN will print the filename
- in all caps at the top of the first page.
-
- You may abort what's printing at any time by pressing escape. PRIN
- will discontinue printing the file, but bear in mind that there are
- two factors to consider:
-
- * Your printer may have a substantial buffer, which is usually full
- because PRIN runs much faster than a printer. The printer will
- continue to print what's in that buffer, even after PRIN has been
- aborted, though PRIN will return to the DOS prompt.
-
- * PRIN checks for an escape before sending each line; DOS suspends
- PRIN while the printer empties enough of its buffer to accept
- another line; only when PRIN has control back will it abort the
- printing.
-
- While we're speaking of aborts, it helps to turn the printer on before
- you start printing, but you don't have to. If it's off, you will get
- the nasty message from DOS: "Error writing device PRN. Abort, Retry,
- Fail, Ignore?". Just turn the printer on and hit r. It will print as
- if nothing had happened. I do this a lot because I turn my printers
- off when something goes wrong, and when you're testing a printing
- program, that is not uncommon.
-
- In answer to the obvious(?) question, no, I can't test if PRN is on. I
- could test to see if LPT 1 was on, but you can use the MODE command to
- redirect PRN to another port, in which I would be testing the wrong
- device. If this doesn't make any sense to you, don't worry, you don't
- need to know it.
-
- PRIN replaces form-feeds embedded in the file with linefeeds, so it
- ignores the existing pagination of the file. This is handy when
- printing out shareware documents that have weird page lengths, useless
- formfeeds, or no pagination at all.
-
- PRIN sends an Escape-@ to the printer on startup, (unless you use the
- i option, explained below), which is a RESET to an Epson and many
- others. Some printers, however, may not understand this code, in
- which case they will not reset.
-
- PRIN depends on you to set the paper to the TOP OF FORM before
- starting. 60 (or whatever is set by the /l parameter) lines will be
- printed, and then a formfeed. When the end of file is reached,
- another formfeed will be sent to eject the last page, and PRIN will
- exit. On dot matrix printers, you can roll the paper up a bit and
- reduce the lines per page with /L to create top margins on all pages.
-
- COMMAND LINE OPTIONS
- ====================
-
- Spaces or forward slashes will have the same effect. Programmers refer
- to these things as delimiters, because they mark the limits of the
- filename and the command line parameters. If you use some that are not
- needed, prin will ignore them.
-
- NO FILENAME AT TOP OF FIRST PAGE: /N
- -----------------------------------
-
- The N option prevents the filename from being printed. You can say
-
- PRIN myfile/N
- or
- PRIN myfile n
-
- Either will stop the filename from being printed.
-
- OMIT DATE AND TIME FROM FILENAME: O
- -----------------------------------
-
- The O option prevents the date and time of the file from being printed.
- If the filename is not printed, then the date and time are automatically
- left off.
-
-
- LINES PER PAGE: L
- -----------------
-
- The L option sets the number of lines to the number following.
- For example:
-
- PRIN filename l55
-
- would cause PRIN to print out the file called filename at 55 lines per
- page. This number must be two digits. ( use 05 for 5 lines per page.)
-
- PAGE NUMBERING: P
- -----------------
-
- The P option numbers the pages in the upper right.
-
- MARGIN AT LEFT: M
- -----------------
-
- The M option adds a left margin of five characters unless the line is
- too long. I add a margin to any line that will fit on the page with
- one. If it won't I print that line without a margin. Using the default
- linelength, you will get margins if your lines are not over 75
- characters. This feature keeps your printout away from the area that
- hole punches punch in.
-
- If you need a margin but have lines longer than 75 chars, what you can
- do is prin to a file on your ramdisk, using the m function and a line
- length of 90 or whatever, then prin the ramdisk file with the t option,
- and chop off whatever is necessary. This is tricky, but will give you a
- good example of how to use prin. Examples and reasons follow.
-
- prin filename f m r90 l00 i
-
- -filename is the file you are printing.
-
- -f means print to file. We do this in two stages.
-
- -r90 means right margin 90 so the left margin can be added even though
- the lines are already 80 chars long.
-
- -l00 tells prin not to put in formfeeds. You want this because when you
- actually print, prin will substitute linefeeds for the formfeeds, and
- you do not want the blank lines.
-
- -i is initialization off. We will let prin initialize the printer when
- we print to the printer. No need for an escape @ in the file we are
- making.
-
- Now that we have our output file, which I will assume you named outfile,
- we go to the business of printing to the printer:
-
- prin outfile n t
-
- -n for no filename on printout because the first time through we got the
- file name, and this time the file name is just the temporary file name
- of the file on the ramdrive, and it is not anything we want on the real
- printout.
-
- -t tells prin to truncate long lines. The default 80 will be used for
- line length unless you use an rxx or rxxx command for something else.
-
- You should now have a printout with a left margin all the way down, and
- the lines that are too long cut off where they had to be. Needless to
- say if you do this sort of thing all the time you will want to do it
- with a batch file that might read something like this if D: is your ram
- disc:
-
- echo d:\temp |prin %1 f m r90 l00 i
- prin d:\temp n t
- del d:\temp
-
- This will run prin twice so fast you will probably wonder what in the
- world it is doing. Note that the name temp must not exist or prin will
- get all huffy about being asked to use an existing file name.
-
- This is provided in advanced.zip as the file mprin.bat
-
- RIGHT MARGIN: Rxx or Rxxx
- -------------------------
-
- (where xx or xxx is a number between 10 and 244.)
- R is the maximum line length. The default is 80. the R parameter
- sets the point at which PRIN will wrap. I wrap at the last space
- before that. I back up half the line length looking for a space
- before I give up and call a procedure called "dumbwrap" that cuts the
- "word" at the edge of the print area. Since
- "antidisestablishmentarianism" is well under 40 characters, you will
- probably not see "dumbwrap" at work unless you try to print out some
- graphics boxes and use too narrow a margin. The default wrap point is
- the last space before 80 characters. This option is not a substitute
- for a word processor. It wraps those lines that do not fit, but
- starts the next line at the beginning. It is intended primarily to
- protect the occasional long line in program source code from being
- chopped off on printing, or printing off the edge of the paper.
-
- INITIALIZATION OFF: I
- ---------------------
-
- You may want to use a batch file that sends a file to the printer with
- copy or some program to set your printer to near letter quality or
- whatever. If you do, this option prevents PRIN from sending the reset
- and wiping out what is in the printer's memory. This means PRIN will
- use whatever font, top of form, etc. the printer is currently set to.
- Not all printers use escape @ and those that do do not all clear the
- same things. Standards? We don't need no stinking standards!
-
- DOUBLESPACE: D
- --------------
-
- Prints blank lines between the lines in the original file. Handy for
- creating a scratch copy of a file without changing the file itself,
- especially if you're writing the file with an editor that does not do
- doublespace.
-
- PRINT TO FILE: F
- ----------------
-
- Prints the output to a file. This file may be printed later with the
- copy command. This lets you use prin to generate such things as
- shareware doc files on discs with embedded formfeeds and page numbers.
- Normally you would not use prin to print this output file, because
- prin would just filter the formfeeds back out again. Prin outputs a
- line at a time, which is reasonable for a printer, but not very
- efficient for writing to files. Large documents are best handled by
- writing to a ram disc and then copying.
-
- To fully appreciate the speed of prin, you need to do a print to disc of
- a large document onto a ramdrive. On a fast machine, you simply will
- not be able to see the last two digits of lines printed.
-
- SET TABSIZE: B
- --------------
-
- Sets the tabsize to a single nonzero digit, 1 to 9.
-
- for example:
-
- PRIN filename B5
-
- would cause prin to space over to the next column that is a multiple of
- 5 each time a tab is encountered. Default is 8, which is the same as
- DOS print uses.
-
-
- ALTERING DEFAULT SETTINGS:
- --------------------------
-
- CLONE: C
- --------
-
- Clones the program to the current settings. The file to be cloned must
- be named prin.com, and it must be in the current directory. Once
- cloned, the program may be named anything you wish provided you keep the
- extension .com. This may be useful for creating one copy that prints
- doublespace, one that prints with no filename, etc, so you can avoid
- typing any parameters at all.
-
- KLONE: K
- --------
-
- Klones the program to the defaults. the file to be cloned must be
- named prin.com, and must be in the current directory. You must give a
- filename, but if you do not want to print something with the current
- settings, the file you name should be nonexistent. Klone will take
- effect, and then prin will try to open the nonexistent file to print
- out, and exit with the file not found error message. Klone affects the
- file on disc, not what is in memory.
-
- EXAMPLE:
- --------
-
- prin nonesuch K
-
- This would Klone the program to the defaults, and then look for nonesuch
- to be printed with the existing settings. Since nonesuch does not
- exist, nothing will be printed with the settings in memory (the old
- ones), and prin will exit, having changed the program on disc to the
- default settings. The next time PRIN is called, the default settings
- will be in effect.
-
- TRUNCATE: T
- -----------
-
- Programmers often want to print out list files that have more than 80
- characters per line. My assembler will make them wrap, and so can prin,
- but that is not really what I want. The stuff that is off the end is
- just the tail ends of comments. It's confusing to have them wrapped to
- come up in the code field. T chops off everything beyond the user
- specified right edge.
-
- BOX ALIASING: A
- ---------------
-
- ---------, The A option allows you to have prin substitute
- : ascii characters for the
- ,----:-------------------, box characters.
- : : Stop :
- : : box :
- : : messes :
- : : :
- : '-------------------'
- :
- : Since this option is needed worst by users with daisey
- : wheel printers, I chose :',- as the alias characters.
- :
- '--------------------------------------,
- :
- :
- '------
-
-
- This gives best chance of being able to print. The | does look a bit
- more like a vertical line, but not much, and I think it is considerably
- less common. And we need to put a stop to these:
-
- ZDDDDDDDDDDDDDDDDDDDDDDDDDDD?
- 3 3
- 3 3
- 3 3
- @DDDDDDDDDDDDDDDDDDDDDDDDDDDY
-
- TOP MARGIN: U
- -------------
-
- Specify a top margin to go on each page below the page numbers and
- filename, and above the text. Must be single digit, so 9 is as big as
- you can go without playing tricks with print to file and so on. 6 lines
- is normally an inch. Most printers have a reasonable top margin of
- their own, but that is not true of a printer owned by one of my
- registered users, Richard Conrad. He sent me some printouts. The
- margins were very near the top. They did not look good. It was
- intolerable. It's fixed. Usage is /ux where x is the number of blank
- lines.
-
- RESPECT ORIGINAL PAGINATION: Z
- ------------------------------
-
- You may have something you think is going to print out all right. What
- you want is for prin to sit quietly by and let the file break pages as
- it wants unless a page goes over the maximum length you allow. This
- will keep the printer off the perforations, but of course it will allow
- one line pages, one of the main curses prin was written to stop.
- However, you may want to add top margins to something that is paginated
- right, or add page numbering, or something I never even thought of. The
- Z option goes to the next page whenever it gets a formfeed out of the
- file. But prin still provides the services you have come to expect.
- Possibly good for things like printing list files you want to truncate
- to 80 chars, or something real tricky you've thought up.
-
-
- EXAMPLES:
- =========
-
- prin PRIN30.doc
-
- This would print PRIN30.DOC at 60 lines per page, with the filename at
- the top of the first page.
-
- prin PRIN30.doc l58 n m p
-
- This will print PRIN30.DOC at 58 lines per page *without* the filename
- at the top, add a margin of five spaces at the left, and number the
- pages.
-
- prin bigfile.txt z f u3 a t r75 L62
-
- This will print BIGFILE.TXT in its original pages unless they go over
- the 62 lines per page the user has specified. Output will be to a file
- the user will be asked for a name for, box characters will be converted
- to ascii, and the long lines will be truncated to the right margin of 75
- the user has specified.
-
-
- PRIN is written in ASSEMBLER, so it is very small and fast. I have run
- {COMMO} in one window of Desqview and PRIN in another with no noticeable
- slowing of print speed on an 8 mhz XT. I have been shamelessly eating
- up memory, and have enlarged my buffer so prin is now 16k in memory.
- Probably you will need to allow 17k to run it from a .bat file under
- Desqview. You will find PRIN works much better than the DOS print in
- this situation, because it uses much less CPU time.Also, PRIN is NOT
- memory resident.
-
-
- ERROR CODES
- ===========
- On errors, I save the DOS error code and return it on termination, so
- you can find out what went wrong if you want. On successful termination,
- I return an errcode of zero. My own errcode is 96. (60h). Have
- fun, batch freaks!
-
-
-
- REGISTRATION:
- =============
-
- Now here is my favorite part: If you use prin, and it works for you, the
- right thing to do is to pay for it. Please send $6 to the address
- below. The I will send you a password and instructions for converting
- PRIN to the registered version.
-
- Registered users can call and get help on assembler, including having an
- escape code file made for them. All you need to do is log on and say,
- "hey, remember me? Well, I just gotta have this escape code, and I
- can't figure out how to do it."
-
- SITE LICENSES
- -------------
-
- I have been asked by one user for a site license price. I considered
- the possibilities of a pricing schedule. If I charged by machines
- using the program, it could be put on a file server and one copy could
- print thousands of pages a day. If I charged by the copy, users who
- had one printer and a large number of computers might pay a lot though
- they do little printing. In the end I decided I could think of no
- formula that would really be fair, and so I told this user what I am
- now telling you. The price of a site license for prin is to be set by
- the user in good faith, as that amount which, all things considered,
- is a fair price. The license is not limited as to the number of
- copies that can be run. It is only the honest few who register at
- all, and in the end, I think they can be trusted to be fair.
-
- THOSE DAMN BLINKING DOTS
- ------------------------
-
- They probably bother me more than they do you. But more a than year
- after the original release of prin, I have less registrations than phone
- bills from uploading it. It's being used all over the world, but people
- are just not getting around to sending checks. It may well be more a
- case of procrastination than dishonesty. I tried to do something that
- would keep registration on your mind without being a pain. The ascii
- 250 I used is the _smallest_ character in the set. It's half the size
- of a period on my (mono) monitor.
-
-
- PRICING:
- --------
-
- Prin is priced considerably lower than most comparable
- programs, if there are such things. This reflects a view of shareware
- that it should be less expensive than commercial software even when it's
- better. If users enthusiastically upload it, and encourage others to
- register, I think I will eventually be paid reasonably for the work I
- have done.
-
- Drake Koefoed
- 1409 Oakpatch road # A 9
- Eugene Oregon 97402
-
-
- LAURELS AND LEGALESE
- ====================
- Desqview is the property of Quarterdeck. It's a great program.
- {Commo} is the property of Fred Brucker. It's a greater program.
-
- The latest version of {Commo} is always available on assembler,
- and first time callers are able to download.
-
-
-
-
- BY USING THIS PROGRAM YOU AGREE TO HOLD THE AUTHOR FREE OF ALL LIABILITY
- OF ANY KIND TO THE EXTENT PERMITTED BY LAW. YOU ASSUME THE RISK OF
- ANYTHING THAT HAPPENS. THIS PROGRAM IS SOLD WITHOUT WARRENTY OF ANY
- KIND, INCLUDING FITNESS FOR A PARTICULAR PURPOSE AND MERCHANTABILITY.
- REMEDIES ARE LIMITED TO THE REFUND OF THE REGISTRATION FEE.
-
-